﻿using System.Windows;
using System.Windows.Controls;

namespace Central
{
    public partial class UcPumps
    {
        public UcPumps()
        {
            InitializeComponent();
        }

        public void Add(UcPump ucPump)
        {
            int column = 1;
            if (grid.Children.Count%2 == 0)
            {
                column = 0;
                grid.RowDefinitions.Add(new RowDefinition {Height = new GridLength(180)});
            }
            
            Grid.SetRow(ucPump, grid.RowDefinitions.Count - 1);
            Grid.SetColumn(ucPump, column);
            grid.Children.Add(ucPump);
        }
    }
}
